/**
 * @projectName: LeetCode
 * @package: PACKAGE_NAME
 * @className: Point6
 * @author: Mocrash
 * @description: TODO
 * @date: 2024/10/18 12:19
 * @version: 1.0
 */
public class Point9 {
    public static void main(String[] args) {
        Solution solution = new Solution();
        boolean paypalishiring = solution.isPalindrome(-1321);
        System.out.println(paypalishiring);
    }

    private static class Solution {
        public boolean isPalindrome(int x) {
            if(x < 0)return false;
            int rec = x;
            int trans = rec % 10;
            rec /= 10;
            while (rec != 0){
                trans = trans * 10 + rec % 10;
                rec /= 10;
            }
            return trans == x;
        }
    }
}
